package extreme;

public class Fizz {

    public static final String FIZZ = "Fizz";
    public static final String BUZZ = "Buzz";
    public static final String WHIZZ = "Whizz";
    public static final String FIZZ_BUZZ = "FizzBuzz";
    public static final String FIZZ_WHIZZ = "FizzWhizz";
    public static final String BUZZ_WHIZZ = "BuzzWhizz";
    public static final String FIZZ_BUZZ_WHIZZ = "FizzBuzzWhizz";
    public static final String THREE = "3";
    public static final String FIVE = "5";
    public static final String SEVEN = "7";
    public static final String THREE_FIVE = "35";
    public static final String SEVEN_FIVE = "75";
    public static final int NUMBER_ZERO = 0;
    public static final int NUMBER_THREE = 3;
    public static final int NUMBER_FIVE = 5;
    public static final int NUMBER_SEVEN = 7;

    private final int number;

    public Fizz(int number) {

        this.number = number;
    }

    public String numberOff() {
        if (isContainBySeventyFive()) {
            return FIZZ;
        } else if (isContainByThreeFive()) {
            return BUZZ_WHIZZ;
        } else if (isContainBySeven()) {
            return WHIZZ;
        } else if (isContainByFive()) {
            return BUZZ;
        } else if (isContainByThree()) {
            return FIZZ;
        } else if (isDivBySeven() && isDivByFive() && isDivByThree()) {
            return FIZZ_BUZZ_WHIZZ;
        } else if (isDivBySeven() && isDivByFive()) {
            return BUZZ_WHIZZ;
        } else if (isDivBySeven() && isDivByThree()) {
            return FIZZ_WHIZZ;
        } else if (isDivByFive() && isDivByThree()) {
            return FIZZ_BUZZ;
        } else if (isDivBySeven()) {
            return WHIZZ;
        } else if (isDivByFive()) {
            return BUZZ;
        } else if (isDivByThree()) {
            return FIZZ;
        }
        return String.valueOf(number);
    }

    private boolean isDivByFive() {

        return number % NUMBER_FIVE == NUMBER_ZERO;
    }

    private boolean isDivByThree() {

        return number % NUMBER_THREE == NUMBER_ZERO;
    }

    private boolean isDivBySeven() {

        return number % NUMBER_SEVEN == NUMBER_ZERO;
    }

    private boolean isContainBySeven() {
        String str = String.valueOf(number);
        return str.contains(SEVEN);
    }

    private boolean isContainByFive() {
        return String.valueOf(number).contains(FIVE);
    }

    private boolean isContainByThree() {
        return String.valueOf(number).contains(THREE);
    }

    private boolean isContainBySeventyFive() {
        return String.valueOf(number).contains(SEVEN_FIVE);
    }

    private boolean isContainByThreeFive() {
        return String.valueOf(number).contains(THREE_FIVE);
    }
}
